<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
    <title>学生信息</title>
    <link rel="stylesheet" href="${ssy}/resources/layui/css/layui.css">
    <script type="text/javascript" src="${ssy}/resources/layui/layui.js"></script>
</head>
<body>
<table id="studentInfo" lay-filter="studentInfoFilter"></table>

<script>
    layui.use(['table'],function(){
        var table = layui.table;

        table.render({
            id:'studentInfoId',
            elem:'#studentInfo',
            url:'${ssy}/student.do?type=studentInfo',
            page:false,
            cols:[[
                {field:'number', title: '学号',align:"center"},
                {field:'sname', title: '姓名',width:110,align:"center"},
                {field:'sex',title:'性别',width:100,align:"center",templet:function(d){
                        if(d.sex=='男'){
                            return "<font color='green'>男</font>"
                        }else if(d.sex=='女'){
                            return "<font color='red'>女</font>"
                        }else{
                            return "";
                        }
                    }},
                {field:'major',title:'专业',width:180,align:"center"},
                {field:'className',title:'班级名称',align:"center"},
                {field:'instructor',title:'辅导员',align:"center"},
                {field:'birthday',title:'出生年月',align:"center"},
                {field:'phone',title:'联系方式',align:"center"},
                {field:'address',title:'家庭地址',align:"center"},
            ]],
            parseData:function(res){ //res 即为原始返回的数据
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": res.data.count, //解析数据长度
                    "data": res.data.list //解析数据列表
                };
            },
            response:{
                statusCode: 200
            }
        });

    })

</script>

</body>
</html>

